package ${packageName};

import ${mapperFullyType};
import ${exampleFullyType};
import ${domainFullyType};
import ${beanMapperFullyType};
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class ${serviceClassName} {

    @Autowired
    private ${mapperClassName} mapper;

    public long countByExample(${exampleClassName} example){
        return mapper.countByExample(example);
    }

    public int deleteByExample(${exampleClassName} example){
        return mapper.deleteByExample(example);
    }

    public int deleteByPrimaryKey(Long id){
        if (id == null){
            return 0;
        }
        return mapper.deleteByPrimaryKey(id);
    }

    public int insert(${domainClassName} row){
        if (row == null){
            return 0;
        }
        return mapper.insert(BeanMapper.map(row));
    }

    public int insertSelective(${domainClassName} row){
        if (row == null){
            return 0;
        }
        return mapper.insertSelective(BeanMapper.map(row));
    }

    public List<${domainClassName}> selectByExample(${exampleClassName} example){
        return BeanMapper.mapAsList(mapper.selectByExample(example));
    }

    public ${domainClassName} findByPrimaryKey(Long id){
        if (id == null){
            return null;
        }
        return BeanMapper.map(mapper.selectByPrimaryKey(id));
    }

    public int updateByExampleSelective(${domainClassName} row,${exampleClassName} example){
        if (row == null){
            return 0;
        }
        return mapper.updateByExampleSelective(BeanMapper.map(row),example);
    }

    public int updateByExample(${domainClassName} row, ${exampleClassName} example){
        if (row == null){
            return 0;
        }
        return mapper.updateByExample(BeanMapper.map(row),example);
    }

    public int updateByPrimaryKeySelective(${domainClassName} row){
        if (row == null){
            return 0;
        }
        return mapper.updateByPrimaryKeySelective(BeanMapper.map(row));
    }

    public int updateByPrimaryKey(${domainClassName} row){
        if (row == null){
            return 0;
        }
        return mapper.updateByPrimaryKey(BeanMapper.map(row));
    }

}